import request from '../utils/request'
/**
 * 评论相关接口
 */
export default {

  uploadPic (data) {
    return request({
      url: 'upload/file.do_',
      method: 'post',
      data
    })
  },
  // 添加评论
  addComment (query) {
    return request({
      url: 'gds/comment/addComment.do_',
      method: 'post',
      data: query
    })
  },

  // 根据订单商品表id获取商品评分
  getGoodsSocre (orderGoodsId) {
    return request({
      url: 'gds/comment/getgoodsSroce.do_',
      method: 'get',
      params: {orderGoodsId: orderGoodsId}
    })
  },
  // 获取评论列表
  getCommentListByGoodsId (query) {
    return request({
      url: 'gds/comment/getCommentList.do_',
      method: 'get',
      params: query
    })
  },
  getCommentById (id) {
    return request({
      url: 'gds/commentReply/getCommentDetailByCommentId.do_',
      method: 'post',
      data: {commentId: id}
    })
  },
  // 删除评论回复
  deleteCommentReplyById (id) {
    return request({
      url: 'gds/commentReply/deleteCommentReplyById.do_',
      method: 'post',
      data: {id: id}
    })
  },
  // 新增评论回复
  insertCommentReply (data) {
    return request({
      url: 'gds/commentReply/insertCommentReply.do_',
      method: 'post',
      data: data
    })
  }
}
